shellEntry should not need to query the clutter-text directly
in order to know if the entry is for passport-input purpose.
shellEntry can easily determine a password-entry by querying
if it is an instance of StPasswordEntry and use it's API
whereever relevant.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/619
this.addMenuItem(item);
this._pasteItem = item;
- this._passwordItem = null;
+ if (entry instanceof St.PasswordEntry)
+ this._makePasswordItem();
Main.uiGroup.add_actor(this.actor);
this.actor.hide();
}
_updatePasswordItem() {
- let textHidden = this._entry.clutter_text.password_char;
- if (textHidden)
+ if (!this._entry.password_visible)
this._passwordItem.label.set_text(_("Show Text"));
else
this._passwordItem.label.set_text(_("Hide Text"));
}
_onPasswordActivated() {
- let visible = !!this._entry.clutter_text.password_char;
- this._entry.clutter_text.set_password_char(visible ? '' : '\u25cf');
+ this._entry.password_visible = !this._entry.password_visible;
}
};